#include "Stack.h"
#include <iostream>
void Stack::push(int data)
{
	putHead(data);
}

int Stack::top()
{
	return peekHead();
}

int Stack::pop()
{
	return getHead();
}

int Stack::size()
{
	return getElemCount();
}

void Stack::print()
{
	using std::cout;
	using std::endl;
	if (size() == 0)
	{
		cout << "Stack is empty!" << endl;
		return;
	}
	cout << "Stack member:" << endl;
	auto point = dataLinkHead;
	while (point)
	{
		cout << "| " << point->data << " |" << endl;
		point = point->next;
	}
	cout << "-----" << endl;
}

bool Stack::empty()
{
	return dataLinkHead == nullptr;
}
